//
//  HKBaseWebViewController.h
//  HKUtilities
//
//  Created by 胡锦涛 on 2018/11/14.
//  Copyright © 2018 胡锦涛. All rights reserved.
//
#import "HKProgressView.h"
#import <UIKit/UIKit.h>
#import "HKWebView.h"

NS_ASSUME_NONNULL_BEGIN
typedef void(^HKWebViewInternalLink)(NSString *internalLink);
typedef void(^HKWebViewShare)(void);
@interface HKBaseWebViewController : UIViewController<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>
///是否是Present
@property (nonatomic, assign) BOOL isPresent;
///是否是全屏
@property (nonatomic, assign) BOOL isFullScreen;
///webView
@property (nonatomic, strong) HKWebView *webView;
///网页链接
@property (nonatomic, strong) NSURL  *webUrl;
///是否需要重置webView高度
@property (nonatomic, assign) BOOL resetWebViewHeight;
///是否展示分享按钮
@property (nonatomic, assign) BOOL showShare;
///导航条背景颜色设置
@property (nonatomic, strong) UIColor *navBgColor;
///导航条字体颜色设置
@property (nonatomic, strong) UIColor *navTitleColor;
///导航条字体大小设置
@property (nonatomic, assign) CGFloat navFont;
///进度条
@property (nonatomic, strong) UIProgressView  *progressView;
///返回按钮
@property (nonatomic, strong) UIBarButtonItem *backItem;
///关闭按钮
@property (nonatomic, strong) UIBarButtonItem *closeItem;
///分享按钮
@property (nonatomic, strong) UIBarButtonItem *shareItem;
///页面加载View
@property (nonatomic, strong) HKProgressView *loadingView;
///拦截内部链接回调
@property (nonatomic, copy) HKWebViewInternalLink linkCallBack;
///分享回调
@property (nonatomic, copy) HKWebViewShare shareCallBack;


- (void)loadWithUrl:(NSURL *)url;
- (void)refreshWithUrl:(NSURL *)url;
- (void)reload;
- (void)backNative;

#pragma mark JS

///是否需要刷新web界面
@property (nonatomic, assign) BOOL isReload;

///判断是否吊起loginFlag方法
@property (nonatomic, assign) BOOL enter;

///登录回调回来
@property (nonatomic, assign) BOOL isLogin;

///JS回调之后的CallBack方法名
@property (nonatomic, strong) NSString *callbackName;

@end

NS_ASSUME_NONNULL_END
